﻿@model MyCryptoChat.ViewModels.StatsViewModel

@{
    ViewBag.Title = "Stats";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Stats about MyCryptoChat</h2>

<p>
    Number of chat rooms: @Model.NbChatrooms<br />
    Number of messages: @Model.NbMessages
</p>

<h3>Chatrooms</h3>
<table>
    <tr>
        <th>Id
        </th>
        <th>Creation date
        </th>
        <th>End date
        </th>
        <th>Messages
        </th>
    </tr>
    @foreach (var item in Model.Chatrooms)
    {
        <tr>
            <td>
                @item.Id
            </td>
            <td>
                @item.DateCreation.ToString()
            </td>
            <td>
                @item.DateEnd.ToString()
            </td>
            <td>
                @item.NbMessages
            </td>
        </tr>
    }
</table>

<p>
    @Html.ActionLink("Back to home", "Index")
</p>
